package com.dao.green.cn.applibary.uis.activities;

import android.databinding.DataBindingUtil;
import android.view.View;
import android.widget.AdapterView;

import com.dao.green.cn.applibary.R;
import com.dao.green.cn.applibary.adapters.acadapter.IndexAcAdapter;
import com.dao.green.cn.applibary.base.BaseActivity;
import com.dao.green.cn.applibary.databinding.AcIndexLayoutBinding;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Ant on 2017/7/27  19:54
 * <p>
 * <p>
 *
 * @version 1.0.0
 * @auther Ant
 */

public class IndexActivity extends BaseActivity {

    protected AcIndexLayoutBinding binding;
    protected IndexAcAdapter adapter;

    protected List<String> strList;
    protected List<Class<? extends BaseActivity>> clsList;

    @Override
    public void createBinding() {
        strList = new ArrayList<>();
        clsList = new ArrayList<>();
        binding = DataBindingUtil.setContentView(this, R.layout.ac_index_layout);
    }

    @Override
    public void initView() {
        adapter = new IndexAcAdapter(this);
        binding.acIndexListView.setAdapter(adapter);
    }

    @Override
    public void initData() {

    }

    @Override
    public void initListener() {
        binding.acIndexListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                goTo(clsList.get(position));
            }
        });
    }
}
